import java.util.Scanner;

public class Day_15_1_查找输入整数二进制中1的个数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int result = sc.nextInt();
            int count = 0;
            while(result != 0) {
                if(result % 2 == 1) {
                    count ++;
                }
                result /= 2;
            }
            System.out.println(count);
        }
    }
}
